<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
        //1.将A5F3转成2进制
        var num ='A5F3';
        var num2=parseInt(num,16);
        var num3=num2.toString(2);
        alert(num3);
        //2.99乘法表
        for (var i=1;i<=9;i++) {
        for (var j=1;j<=i;j++) {
            var num=i*j
            document.write(j+"*"+i+"="+num);
            document.write(" ");
        }
            document.write("</br>") 
        }
        //  3.输入年月，（用数组）
        //3.1.计算当月有多少天
        //3.2.计算还剩多少天
        const bmonth=[1,3,5,7,8,10,12]
        const smonth=[4,6,9,11]
        var b=prompt("请输入年份")
        var a=prompt("请输入月份")
        var c=prompt("请输入号数")
        for(i=0;i<bmonth.length;i++){
        if (a==2&&b%4==0) {
            document.write("这个月有29天")
            document.write("这个月还有",29-c,"天")
            break;
        }else if(a==2&&b%4!=0){
            document.write("这个月有28天")
            document.write("这个月还有",28-c,"天")
            break;
        }else if(a==bmonth[i]){
            document.write("这个月有31天")
            document.write("这个月还有",31-c,"天")
                break;
        }else if(a==smonth[i]){
            document.write("这个月有30天")
            document.write("这个月还有",30-c,"天")
                break;
        }else{
            document.write("错误，请重新输入")
            break;
        }}
        


    </script>
</body>
</html>